package com.frogs.ucenter.v1.request;

import javax.servlet.http.HttpServletRequest;

import com.frogs.framework.web.HttpRequestInfo;
import com.frogs.system.util.ApiUrlParamEnum;
import com.frogs.system.util.AttentionStateEnum;
import com.frogs.system.util.HdcReceiveStateEnum;
import com.frogs.system.util.OpenPlatformEnum;
import com.frogs.system.util.SexEnum;
import com.frogs.system.web.api.request.Request;
import com.frogs.system.web.exception.RequestIllegalException;

/**
 * 关注添加参数类
 *
 * @author wushubin
 */
public class UserAttentionUpdateRequest extends Request {

	private Integer followedUserId;
	
	private Integer followUserId;
	
	private Integer isReceiveAlert;
	
	private String relatives;
	
	private Integer openPlatformId;
	
	private Integer status;
	
	private Integer sex;
	
	private Integer age;
	
	private String phone;
	
	private String identityCard;
	
	private String realName;
	
	private String birthday;
	
	/** */
	public UserAttentionUpdateRequest() {
		
	}
	
	@Override
	public void parse(HttpServletRequest request) {
		HttpRequestInfo requestInfo = new HttpRequestInfo(request);
		
		this.followedUserId = requestInfo.getIntParameter(ApiUrlParamEnum.followedUserId.getParamName(),-1);
		this.followUserId = requestInfo.getIntParameter(ApiUrlParamEnum.followUserId.getParamName(), -1);
		this.isReceiveAlert = requestInfo.getIntParameter(ApiUrlParamEnum.isReceiveAlert.getParamName(), HdcReceiveStateEnum.RECEIVE_MESSAGE.getId());
		this.relatives = requestInfo.getParameter(ApiUrlParamEnum.relatives.getParamName(), "");
		this.openPlatformId = requestInfo.getIntParameter(ApiUrlParamEnum.openPlatformId.getParamName(), OpenPlatformEnum.WECHAT_HDC.getId());
		this.status = requestInfo.getIntParameter(ApiUrlParamEnum.status.getParamName(), AttentionStateEnum.ATTENTION_STATUS_AGREED.getId());
		this.age = requestInfo.getIntParameter(ApiUrlParamEnum.age.getParamName(), 0);
		this.sex = requestInfo.getIntParameter(ApiUrlParamEnum.sex.getParamName(), SexEnum.UNKNOW.getId());
		this.phone = requestInfo.getParameter(ApiUrlParamEnum.phone.getParamName(), "");
		this.identityCard = requestInfo.getParameter(ApiUrlParamEnum.identityCard.getParamName(), "");
		this.realName = requestInfo.getParameter(ApiUrlParamEnum.realName.getParamName(), "");
		this.birthday = requestInfo.getParameter(ApiUrlParamEnum.birthday.getParamName(), "");
		if (followUserId < 1) {
			throw new RequestIllegalException("error followUserId: " + followUserId);
		}
		
		if (followedUserId < 1) {
			throw new RequestIllegalException("error followedUserId: " + followedUserId);
		}
		
	}

	public Integer getFollowedUserId() {
		return followedUserId;
	}

	public void setFollowedUserId(Integer followedUserId) {
		this.followedUserId = followedUserId;
	}

	public Integer getFollowUserId() {
		return followUserId;
	}

	public void setFollowUserId(Integer followUserId) {
		this.followUserId = followUserId;
	}

	public Integer getIsReceiveAlert() {
		return isReceiveAlert;
	}

	public void setIsReceiveAlert(Integer isReceiveAlert) {
		this.isReceiveAlert = isReceiveAlert;
	}

	public String getRelatives() {
		return relatives;
	}

	public void setRelatives(String relatives) {
		this.relatives = relatives;
	}

	public Integer getOpenPlatformId() {
		return openPlatformId;
	}

	public void setOpenPlatformId(Integer openPlatformId) {
		this.openPlatformId = openPlatformId;
	}
	
	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public Integer getSex() {
		return sex;
	}

	public void setSex(Integer sex) {
		this.sex = sex;
	}

	public Integer getAge() {
		return age;
	}

	public void setAge(Integer age) {
		this.age = age;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getIdentityCard() {
		return identityCard;
	}

	public void setIdentityCard(String identityCard) {
		this.identityCard = identityCard;
	}

	public String getRealName() {
		return realName;
	}

	public void setRealName(String realName) {
		this.realName = realName;
	}

	public String getBirthday() {
		return birthday;
	}

	public void setBirthday(String birthday) {
		this.birthday = birthday;
	}
	
}
